package com.heima.user.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.dtos.UserRelationDto;
import com.heima.user.service.ApUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Geralt
 * @Date 2024-08-01 21:02
 */
@Slf4j
@RestController
@RequestMapping("/api/v1/user")
public class UserController {
    @Autowired
    private ApUserService apUserService;
    /**
     * 关注或者取消
     *
     * @return
     */
    @PostMapping("/user_follow")
    public ResponseResult userFollow(@RequestBody UserRelationDto userRelationDto) {
        log.info("用户关注或者取消的数据是：{}", userRelationDto);
        return apUserService.userFollow(userRelationDto);
    }
}
